package com.zcy.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;


@Entity
@Table(name = "T_ENTITY_PROPETY")
public class EntityProperty extends BaseEntity {

	private static final long serialVersionUID = 1L;

	// 属性标识
	@Column(name = "EP_NAME")
	private String name;
	// 属性描述
	@Column(name = "EP_DESC")
	private String describe;
	// 属性类型
	@Column(name = "EP_TYPE")
	private String type;
	// 属性格式化
	@Column(name = "EP_DATAFROMAT")
	private String dataFromat;
	// 是否是double类型
	@Column(name = "EP_DBCOLUMN")
	private Boolean dbColumn;
	// 数据库列名
	@Column(name = "EP_COLUMNNAME")
	private String columnName;
	// 长度
	@Column(name = "EP_LENGTH")
	private Integer length;
	// 是否允许为空
	@Column(name = "EP_NULLABLE")
	private Boolean nullable;
	// 是否唯一
	@Column(name = "EP_UNIQUE")
	private Boolean unique;
	// 注释
	@Column(name = "EP_COMMENT")
	private String comment;
	// 默认值
	@Column(name = "EP_DEFAULT_VALUE")
	private String defaultVal;
	// 精度
	@Column(name = "EP_SCALE")
	private Integer scale;

	@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE }, optional = true)
	@JoinColumn(name = "ENTITY_ID")
	private EntityInfo entityInfo;

	@OneToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE }, optional = true, mappedBy = "descProperty")
	private EntityRelationshipInfo relationshipInfo;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public Integer getLength() {
		return length;
	}

	public void setLength(Integer length) {
		this.length = length;
	}

	public Boolean getNullable() {
		return nullable;
	}

	public void setNullable(Boolean nullable) {
		this.nullable = nullable;
	}

	public Boolean getUnique() {
		return unique;
	}

	public void setUnique(Boolean unique) {
		this.unique = unique;
	}

	public String getDataFromat() {
		return dataFromat;
	}

	public void setDataFromat(String dataFromat) {
		this.dataFromat = dataFromat;
	}

	public Boolean getDbColumn() {
		return dbColumn;
	}

	public void setDbColumn(Boolean dbColumn) {
		this.dbColumn = dbColumn;
	}

	public EntityInfo getEntityInfo() {
		return entityInfo;
	}

	public void setEntityInfo(EntityInfo entityInfo) {
		this.entityInfo = entityInfo;
	}

	public EntityRelationshipInfo getRelationshipInfo() {
		return relationshipInfo;
	}

	public void setRelationshipInfo(EntityRelationshipInfo relationshipInfo) {
		this.relationshipInfo = relationshipInfo;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public Integer getScale() {
		return scale;
	}

	public void setScale(Integer scale) {
		this.scale = scale;
	}

	public String getDescribe() {
		return describe;
	}

	public void setDescribe(String describe) {
		this.describe = describe;
	}

	public String getDefaultVal() {
		return defaultVal;
	}

	public void setDefaultVal(String defaultVal) {
		this.defaultVal = defaultVal;
	}

}
